package framework.impl;

import org.openintents.sensorsimulator.hardware.Sensor;
import org.openintents.sensorsimulator.hardware.SensorEvent;
import org.openintents.sensorsimulator.hardware.SensorEventListener;
import org.openintents.sensorsimulator.hardware.SensorManagerSimulator;

import android.content.Context;
import android.hardware.SensorManager;



public class AccelerometerHandlerSimulator implements SensorEventListener {
	  float accelX;
	  float accelY;
	  float accelZ;
	  public AccelerometerHandlerSimulator(Context context,SensorManagerSimulator manager){
		  
	      manager.registerListener(this, manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), 
	    		  SensorManager.SENSOR_DELAY_FASTEST);
	      
	  }
	@Override
	public void onAccuracyChanged(Sensor sensor, int accuracy) {
		// noting to do here

	}

	@Override
	public void onSensorChanged(SensorEvent event) {
		accelX=event.values[0];
		accelY=event.values[1];
		accelZ=event.values[2];
	}
	
	 public float getAccelX() {
	        return accelX;
	    }

	 public float getAccelY() {
	        return accelY;
	    }

	 public float getAccelZ() {
	        return accelZ;
	    }

}
